
convert.o:     file format elf32-littlearm


Disassembly of section .text:

00000000 <f>:


int (*pf)(void);

int f(void)
{
   0:	e92d4800 	push	{fp, lr}
   4:	e28db004 	add	fp, sp, #4
	printf("================= wise\n");
   8:	e59f000c 	ldr	r0, [pc, #12]	; 1c <f+0x1c>
   c:	ebfffffe 	bl	0 <puts>
	return 1;
  10:	e3a03001 	mov	r3, #1
}
  14:	e1a00003 	mov	r0, r3
  18:	e8bd8800 	pop	{fp, pc}
  1c:	00000000 	.word	0x00000000

00000020 <test_pf>:

void test_pf()
{
  20:	e92d4800 	push	{fp, lr}
  24:	e28db004 	add	fp, sp, #4
	pf = &f;
  28:	e59f3048 	ldr	r3, [pc, #72]	; 78 <test_pf+0x58>
  2c:	e59f2048 	ldr	r2, [pc, #72]	; 7c <test_pf+0x5c>
  30:	e5832000 	str	r2, [r3]
	pf();
  34:	e59f303c 	ldr	r3, [pc, #60]	; 78 <test_pf+0x58>
  38:	e5933000 	ldr	r3, [r3]
  3c:	e12fff33 	blx	r3

	pf = f;
  40:	e59f3030 	ldr	r3, [pc, #48]	; 78 <test_pf+0x58>
  44:	e59f2030 	ldr	r2, [pc, #48]	; 7c <test_pf+0x5c>
  48:	e5832000 	str	r2, [r3]
	pf();
  4c:	e59f3024 	ldr	r3, [pc, #36]	; 78 <test_pf+0x58>
  50:	e5933000 	ldr	r3, [r3]
  54:	e12fff33 	blx	r3

	pf = ****f;
  58:	e59f3018 	ldr	r3, [pc, #24]	; 78 <test_pf+0x58>
  5c:	e59f2018 	ldr	r2, [pc, #24]	; 7c <test_pf+0x5c>
  60:	e5832000 	str	r2, [r3]
	pf();
  64:	e59f300c 	ldr	r3, [pc, #12]	; 78 <test_pf+0x58>
  68:	e5933000 	ldr	r3, [r3]
  6c:	e12fff33 	blx	r3

	(***************************************************f)();	// 任何函数都可以这样调用.
  70:	ebfffffe 	bl	0 <f>
}
  74:	e8bd8800 	pop	{fp, pc}
	...

00000080 <re>:

int re()
{
  80:	e52db004 	push	{fp}		; (str fp, [sp, #-4]!)
  84:	e28db000 	add	fp, sp, #0
  88:	e24dd014 	sub	sp, sp, #20
	return ((int []){1,2,3,4})[3];	// 4.    ((int []){1,2,3,4})[2] = 3; []前面为数组,[]里为数组标号
  8c:	e59f301c 	ldr	r3, [pc, #28]	; b0 <re+0x30>  variable
  90:	e24bc014 	sub	ip, fp, #20     ; ip = stack point
  94:	e893000f 	ldm	r3, {r0, r1, r2, r3}
  98:	e88c000f 	stm	ip, {r0, r1, r2, r3}
  9c:	e51b3008 	ldr	r3, [fp, #-8] ; tmp[3] = 4
}
  a0:	e1a00003 	mov	r0, r3
  a4:	e24bd000 	sub	sp, fp, #0
  a8:	e49db004 	pop	{fp}		; (ldr fp, [sp], #4)
  ac:	e12fff1e 	bx	lr
  b0:	00000018 	.word	0x00000018

000000b4 <foo>:

unsigned long foo()
{
  b4:	e92d4800 	push	{fp, lr}
  b8:	e28db004 	add	fp, sp, #4
	printf("\t=========== %ld\n", (unsigned long) - 1);	// -1
  bc:	e3e01000 	mvn	r1, #0                        ; ~0 = 0xffff
  c0:	e59f003c 	ldr	r0, [pc, #60]	; 104 <foo+0x50>
  c4:	ebfffffe 	bl	0 <printf>
	printf("\t--------11= %ld\n", (-1 / 8));	// 0
  c8:	e3a01000 	mov	r1, #0
  cc:	e59f0034 	ldr	r0, [pc, #52]	; 108 <foo+0x54>
  d0:	ebfffffe 	bl	0 <printf>

	printf("\t--------(-1)= %ld\n", ((unsigned int)(-1)));	// -1
  d4:	e3e01000 	mvn	r1, #0                           ; ~0 = ffff
  d8:	e59f002c 	ldr	r0, [pc, #44]	; 10c <foo+0x58>
  dc:	ebfffffe 	bl	0 <printf>
	printf("\t--------(-1)= %ld\n", ((unsigned int)(-1))+1);	// 0
  e0:	e3a01000 	mov	r1, #0
  e4:	e59f0020 	ldr	r0, [pc, #32]	; 10c <foo+0x58>
  e8:	ebfffffe 	bl	0 <printf>
	printf("\t--------( 0)= %ld\n", ((unsigned int)(0)));	// 0
  ec:	e3a01000 	mov	r1, #0
  f0:	e59f0018 	ldr	r0, [pc, #24]	; 110 <foo+0x5c>
  f4:	ebfffffe 	bl	0 <printf>
	return (unsigned long) - 1 / 8;			// 536870911	0x1FFFFFFF
  f8:	e3e0320e 	mvn	r3, #-536870912	; 0xe0000000
}
  fc:	e1a00003 	mov	r0, r3
 100:	e8bd8800 	pop	{fp, pc}
 104:	00000028 	.word	0x00000028
 108:	0000003c 	.word	0x0000003c
 10c:	00000050 	.word	0x00000050
 110:	00000064 	.word	0x00000064

00000114 <foo2>:

unsigned long foo2()
{
 114:	e52db004 	push	{fp}		; (str fp, [sp, #-4]!)
 118:	e28db000 	add	fp, sp, #0
	return ((unsigned long) - 1) / 8;		// 536870911	0x1FFFFFFF
 11c:	e3e0320e 	mvn	r3, #-536870912	; 0xe0000000
}
 120:	e1a00003 	mov	r0, r3
 124:	e24bd000 	sub	sp, fp, #0
 128:	e49db004 	pop	{fp}		; (ldr fp, [sp], #4)
 12c:	e12fff1e 	bx	lr

00000130 <foo3>:

unsigned long foo3()
{
 130:	e52db004 	push	{fp}		; (str fp, [sp, #-4]!)
 134:	e28db000 	add	fp, sp, #0
	return (unsigned long) (-1 / 8);		// 0
 138:	e3a03000 	mov	r3, #0
}
 13c:	e1a00003 	mov	r0, r3
 140:	e24bd000 	sub	sp, fp, #0
 144:	e49db004 	pop	{fp}		; (ldr fp, [sp], #4)
 148:	e12fff1e 	bx	lr

0000014c <fxxx>:


int xxx = 7;
int fxxx()
{
 14c:	e52db004 	push	{fp}		; (str fp, [sp, #-4]!)
 150:	e28db000 	add	fp, sp, #0
 154:	e24dd00c 	sub	sp, sp, #12
	int xxx = 3;
 158:	e3a03003 	mov	r3, #3
 15c:	e50b3008 	str	r3, [fp, #-8] ; xxx = 3, not global
	{
		extern int xxx;
		return xxx;	// 7
 160:	e59f3010 	ldr	r3, [pc, #16]	; 178 <fxxx+0x2c> global xxx
 164:	e5933000 	ldr	r3, [r3]        ; get global xxx value
	}
}
 168:	e1a00003 	mov	r0, r3
 16c:	e24bd000 	sub	sp, fp, #0
 170:	e49db004 	pop	{fp}		; (ldr fp, [sp], #4)
 174:	e12fff1e 	bx	lr
 178:	00000000 	.word	0x00000000

0000017c <iii>:

int iii()
{
 17c:	e52db004 	push	{fp}		; (str fp, [sp, #-4]!)
 180:	e28db000 	add	fp, sp, #0
	return ((1 - sizeof(int)) >> 31);	// 1
 184:	e3a03001 	mov	r3, #1
}
 188:	e1a00003 	mov	r0, r3
 18c:	e24bd000 	sub	sp, fp, #0
 190:	e49db004 	pop	{fp}		; (ldr fp, [sp], #4)
 194:	e12fff1e 	bx	lr

00000198 <point_to_long>:


void point_to_long(char *name)
{
 198:	e52db004 	push	{fp}		; (str fp, [sp, #-4]!)
 19c:	e28db000 	add	fp, sp, #0
 1a0:	e24dd014 	sub	sp, sp, #20
 1a4:	e50b0010 	str	r0, [fp, #-16] ; name
	unsigned long addr;

	addr = (unsigned long)name;
 1a8:	e51b3010 	ldr	r3, [fp, #-16] ; name
 1ac:	e50b3008 	str	r3, [fp, #-8]  ; addr
}
 1b0:	e24bd000 	sub	sp, fp, #0
 1b4:	e49db004 	pop	{fp}		; (ldr fp, [sp], #4)
 1b8:	e12fff1e 	bx	lr

000001bc <invoke>:


void invoke()
{
 1bc:	e92d4800 	push	{fp, lr}
 1c0:	e28db004 	add	fp, sp, #4
	printf("invoke re   ======== %ld\n",  re());		// 4
 1c4:	ebfffffe 	bl	80 <re>
 1c8:	e1a03000 	mov	r3, r0  ; re return value
 1cc:	e1a01003 	mov	r1, r3  
 1d0:	e59f0068 	ldr	r0, [pc, #104]	; 240 <invoke+0x84>
 1d4:	ebfffffe 	bl	0 <printf>
	printf("invoke foo  ======== %ld\n", foo());	// 536870911 
 1d8:	ebfffffe 	bl	b4 <foo>
 1dc:	e1a03000 	mov	r3, r0
 1e0:	e1a01003 	mov	r1, r3
 1e4:	e59f0058 	ldr	r0, [pc, #88]	; 244 <invoke+0x88>
 1e8:	ebfffffe 	bl	0 <printf>
	printf("invoke foo2 ======== %ld\n", foo2());	// 536870911 
 1ec:	ebfffffe 	bl	114 <foo2>
 1f0:	e1a03000 	mov	r3, r0
 1f4:	e1a01003 	mov	r1, r3
 1f8:	e59f0048 	ldr	r0, [pc, #72]	; 248 <invoke+0x8c>
 1fc:	ebfffffe 	bl	0 <printf>
	printf("invoke foo3 ======== %ld\n", foo3());	// 0
 200:	ebfffffe 	bl	130 <foo3>
 204:	e1a03000 	mov	r3, r0
 208:	e1a01003 	mov	r1, r3
 20c:	e59f0038 	ldr	r0, [pc, #56]	; 24c <invoke+0x90>
 210:	ebfffffe 	bl	0 <printf>
	printf("invoke iii    ======== %ld\n", iii());	// 1
 214:	ebfffffe 	bl	17c <iii>
 218:	e1a03000 	mov	r3, r0
 21c:	e1a01003 	mov	r1, r3
 220:	e59f0028 	ldr	r0, [pc, #40]	; 250 <invoke+0x94>
 224:	ebfffffe 	bl	0 <printf>
	printf("invoke fxxx    ======== %ld\n", fxxx());	// 7
 228:	ebfffffe 	bl	14c <fxxx>
 22c:	e1a03000 	mov	r3, r0
 230:	e1a01003 	mov	r1, r3
 234:	e59f0018 	ldr	r0, [pc, #24]	; 254 <invoke+0x98>
 238:	ebfffffe 	bl	0 <printf>
}
 23c:	e8bd8800 	pop	{fp, pc}
 240:	00000078 	.word	0x00000078
 244:	00000094 	.word	0x00000094
 248:	000000b0 	.word	0x000000b0
 24c:	000000cc 	.word	0x000000cc
 250:	000000e8 	.word	0x000000e8
 254:	00000104 	.word	0x00000104

00000258 <main>:

int main()
{
 258:	e92d4800 	push	{fp, lr}
 25c:	e28db004 	add	fp, sp, #4

	test_pf();
 260:	ebfffffe 	bl	20 <test_pf>
	(***************************test_pf)();	// 两种不同的调用方式.效果相同.
 264:	ebfffffe 	bl	20 <test_pf>
	invoke();
 268:	ebfffffe 	bl	1bc <invoke>
	
	return 0;
 26c:	e3a03000 	mov	r3, #0
}
 270:	e1a00003 	mov	r0, r3
 274:	e8bd8800 	pop	{fp, pc}
